package com.woniuxy.yoga.coach.client;

import com.woniuxy.yoga.coach.client.dto.product.AllTeamProductDTO;
import com.woniuxy.yoga.coach.client.dto.product.PrivateProductByIdDTO;
import com.woniuxy.yoga.commons.core.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 产品的服务接口访问类
 */
@FeignClient(name = "product-service",path = "/product")
public interface ProductClient {

    /**
     * 教练ID查询团队产品
     * @param ids
     * @return
     */
    @PostMapping("/teamProduct/getByCoachId")
    public Result<List<AllTeamProductDTO>> getProductByCoachId(@RequestBody List<Integer> ids);

    /**
     * 判断该教练是否存在私教产品
     * @param coachId
     * @return
     */
    @GetMapping("/privateProduct/checkExistByCoachId/{coachId}")
    public Result<PrivateProductByIdDTO> checkExistPrivateByCoachId(@PathVariable("coachId") Integer coachId);

    /**
     * 私教产品上架
     * @param privateProductId
     * @return
     */
    @GetMapping("/privateProduct/normalPrivateProduct/{privateProductId}.bu")
    public Result<?> normalPrivateProduct(@PathVariable("privateProductId") Integer privateProductId);

    /**
     * 私教产品下架
     * @param privateProductId
     * @return
     */
    @GetMapping("/privateProduct/disablePrivateProduct/{privateProductId}.bu")
    public Result<?> disablePrivateProduct(@PathVariable("privateProductId") Integer privateProductId);

    /**
     * 私教产品删除
     * @param privateProductId
     * @return
     */
    @GetMapping("/privateProduct/deletePrivateProduct/{privateProductId}.bu")
    public Result<?> deletePrivateProduct(@PathVariable("privateProductId") Integer privateProductId);
}
